package com.game.graphics;

import java.util.Random;

public class Screen extends Render
{

	private Render test;

	public Screen(int width, int height)
	{
		super(width, height);
		Random random = new Random();
		test = new Render(256, 256);
		for (int i = 0; i < 256 * 256; i++)
		{
			test.pixels[i] = random.nextInt();
		}
	}

	public void render()
	{
		for(int i = 0; i < pixels.length;i++)
			pixels[i] = 0;
		
		for (int i = 0; i < 500; i++)
		{
			int anim = (int) (Math.sin(System.currentTimeMillis() % 2000.0 / 2000 * Math.PI * 2) * 50);
			int anim2 = (int) (Math.cos(System.currentTimeMillis() % 2000.0 / 2000 * Math.PI * 2) * 50);

			int ajustedWidth = (width - 256) / 2 + anim;
			int ajustedHeight = (height - 256) / 2 + anim2;

			draw(test, ajustedWidth, ajustedHeight);
		}
	}
}
